﻿/**************************************************************
 *
 * 命名空间：Sgr.DataCategories.Application.Commands.AdministrativeDivisions
 * 创建时间：2025/3/19
 * 描述：创建行政区划命令
 *
 **************************************************************/

using MediatR;
using Sgr.Application.Commands;
using Sgr.Domain.Uow;

namespace Sgr.DataCategories.Application.Commands.AdministrativeDivisions
{
    /// <summary>
    /// 创建行政区划命令
    /// </summary>
    public class CreateAdministrativeDivisionCommand : IRequest<CommandResult<bool>>, IRequireUnitOfWork
    {
        /// <summary>
        /// 行政区划代码
        /// </summary>
        public string Code { get; set; } = string.Empty;

        /// <summary>
        /// 行政区划名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 上级行政区划ID
        /// </summary>
        public long? ParentId { get; set; }

        /// <summary>
        /// 行政区划简称
        /// </summary>
        public string? ShortName { get; set; }

        /// <summary>
        /// 行政区划描述
        /// </summary>
        public string? Description { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int OrderNumber { get; set; } = 0;

        /// <summary>
        /// 创建一个新的创建行政区划命令实例
        /// </summary>
        public CreateAdministrativeDivisionCommand()
        {
        }

        /// <summary>
        /// 创建一个新的创建行政区划命令实例
        /// </summary>
        /// <param name="code">行政区划代码</param>
        /// <param name="name">名称</param>
        /// <param name="parentId">上级行政区划ID</param>
        /// <param name="shortName">简称</param>
        /// <param name="description">描述</param>
        /// <param name="orderNumber">排序号</param>
        public CreateAdministrativeDivisionCommand(
            string code,
            string name,
            long? parentId = null,
            string? shortName = null,
            string? description = null,
            int orderNumber = 0)
        {
            Code = code;
            Name = name;
            ParentId = parentId;
            ShortName = shortName;
            Description = description;
            OrderNumber = orderNumber;
        }
    }
}